package cn.edu.neusoft.wuguangsheng.flowerimpression.activity;

import android.view.View;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

import cn.edu.neusoft.wuguangsheng.flowerimpression.R;
import cn.edu.neusoft.wuguangsheng.flowerimpression.Utils.DonwloadSaveImg;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;

public class PhotoInfoActivity extends BaseActivity {
    PhotoView photoView;
    String imgpath;
    ImageView photoinfo_download;
    DonwloadSaveImg donwloadImg = new DonwloadSaveImg();

    @Override
    void initView() {
        setLayout_file(R.layout.activity_photo_info);
        photoView = (PhotoView)findViewById(R.id.iv_imageshow);
        photoinfo_download = (ImageView)findViewById(R.id.photoinfo_download);
        imgpath = getIntent().getStringExtra("imgpath");
        Picasso.with(this).load(imgpath).into(photoView);
    }

    @Override
    void initEvent() {
   photoView.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
       @Override
       public void onViewTap(View view, float x, float y) {
           finish();
       }
   });
   photoinfo_download.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View view) {
           donwloadImg.donwloadImg(PhotoInfoActivity.this,imgpath);
       }
   });
    }

    @Override
    void initDate() {

    }
}
